package com.yunhai.model.entity.ums;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;

@ApiModel(value = "UmsUserRole", description = "用户角色关联实体")
@TableName("ums_user_role")
@Data
@Accessors(chain = true)
public class UmsUserRole {

    // 联合主键字段（MyBatis-Plus 需特殊处理）
    @ApiModelProperty(value = "用户ID", required = true, example = "1917583197156151299")
    @TableId() // 联合主键需手动处理
    private Long userId;

    @ApiModelProperty(value = "角色ID", required = true, example = "10001")
    private Long roleId;

    @ApiModelProperty(value = "创建人ID", hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private Long createdBy;

    @ApiModelProperty(value = "更新人ID", hidden = true)
    @TableField(fill = FieldFill.UPDATE)
    private Long updatedBy;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "更新时间", hidden = true)
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updatedAt;
}
